<template>
	<view>
		<template v-if="isLoad">
			<view class="list" style="background-color: #FFFFFF;">
				<topic-reply-item v-for="item of replies" :key="item['id']" :item="item" />
			</view>
		</template>
		<data-empty v-if="!replies.length" /> 
	</view>
</template>

<script>
	export default {
		data (){
			return {
				replies: [],
				isLoad: false
			}
		},
		onLoad (){
			const { loginname } = this.$store.state.user_message
			this.getAuthorDetail(loginname)
		},
		methods: {
			async getAuthorDetail (author){
				uni.showLoading()
				let result = await this.$request.get('/user/'+author)
				let { data } = result
				if(result.success){
					this.replies = data['recent_replies']
				}
				this.isLoad = true
				uni.hideLoading()
			}
		}
	}
</script>

<style>
</style>
